﻿@{
    Layout = null;
}
@using Models;

<div class="bjui-pageHeader"></div>
<div class="bjui-pageContent">
    <form action="ProductEdit" id="Products_edit" data-toggle="validate" data-alertmsg="false" autocomplete="off">
        <table class="table table-condensed table-hover" width="100%">
            <tbody>
                @if (Model != null)
                {
                    <tr>
                        <td>
                            <label class="control-label x100">编号：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Id" id="Id" value="@Model.Id" size="15" readonly>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">产品名称：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Product_name" id="Product_name" data-rule="产品名称:required" maxlength="15" value="@Model.Product_name" size="15" placeholder="[必填] 产品名称">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">产品编号：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Product_No" id="Product_No" data-rule="产品编号:required" maxlength="15" value="@Model.Product_No" size="15" placeholder="[必填] 产品编号">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">类型：</label>
                        </td>
                        <td>
                            <input type="hidden" id="ProductType_Id" name="ProductType_Id" value="@Model.ProductType_Id" />
                            <input type="text" name="ProductType_name" id="ProductType_name" value="****" data-rule="类型:required" readonly placeholder="[必填] 类型" data-toggle="findgrid"
                                   data-options="{
                        group: '',
                        include: 'ProductType_Id,ProductType_name',
                        dialogOptions: {title:'选择类型'},
                        gridOptions: {
                            local: 'local',
                            dataUrl: 'Product/SearchType',
                            columns: [
                                {name:'ProductType_Id', label:'ID', width:100},
                                {name:'ProductType_name', label:'类型'}
                            ]
                        }
                    }">
                        </td>
                    </tr>
                    @*<tr>
                        <td>
                            <label class="control-label x100">下载地址：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Product_url" id="Product_url" data-rule="下载地址:required" value="@Model.Product_url" size="15" placeholder="[必填] 下载地址">

                        </td>
                    </tr>*@
                    <tr>
                        <td>
                            <label class="control-label x100">下载文件：</label>
                        </td>
                        <td>
                            <input type="text" name="Product_url" id="Product_url" value="@Model.Product_url" data-rule="下载地址:required" readonly placeholder="[必填] 下载文件" data-toggle="findgrid" data-options="{
                        group: '',
                        include: 'Product_url',
                        dialogOptions: {title:'选择文件'},
                        gridOptions: {
                            local: 'local',
                            dataUrl: 'Product/search',
                            columns: [
                                {name:'Product_url', label:'名称', width:100},
                                {name:'uploadurl', label:'地址'},
                                {name:'date', label:'创建日期'}
                            ]
                        }
                    }">  <a class="btn btn-green" href="Product/Upload" data-toggle="dialog" data-mask="true" data-width="500" data-height="150" data-id="ProductUpload" data-icon="cloud-upload">上传文件</a>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">产品说明：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Product_txt" id="Product_txt" maxlength="15" value="@Model.Product_txt" size="20" placeholder="产品说明">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">状态：</label>
                        </td>
                        <td>
                            @if (Model.Disable == 1)
                            {
                                <input runat="server" type="checkbox" id="Disable" name="Disable" value="1" checked data-toggle="icheck" data-label="正常">
                            }
                            else
                            {
                                <input runat="server" type="checkbox" id="Disable" name="Disable" value="1" data-toggle="icheck" data-label="正常">
                            }
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">备注：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Disabledesc" id="Disabledesc" maxlength="15" value="@Model.Disabledesc" size="20" placeholder="备注">
                        </td>
                    </tr>
                }
                else
                {

                    <tr>
                        <td>
                            <label class="control-label x100">产品名称：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Product_name" id="Product_name" data-rule="产品名称:required" maxlength="15" value="" size="15" placeholder="[必填] 产品名称">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">产品编号：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Product_No" id="Product_No" data-rule="产品编号:required" maxlength="15" value="" size="15" placeholder="[必填] 产品编号">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">类型：</label>
                        </td>
                        <td>
                            <input type="hidden" id="ProductType_Id" name="ProductType_Id" value="" />
                            <input type="text" name="ProductType_name" id="ProductType_name" value="" data-rule="类型:required" readonly placeholder="[必填] 类型" data-toggle="findgrid"
                                   data-options="{
                        group: '',
                        include: 'ProductType_Id,ProductType_name',
                        dialogOptions: {title:'选择类型'},
                        gridOptions: {
                            local: 'local',
                            dataUrl: 'Product/SearchType',
                            columns: [
                                {name:'ProductType_Id', label:'ID', width:100},
                                {name:'ProductType_name', label:'类型'}
                            ]
                        }
                    }">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">下载文件：</label>
                        </td>
                        <td>
                            <input type="text" name="Product_url" id="Product_url" value="" data-rule="下载地址:required" readonly  placeholder="[必填] 下载文件" data-toggle="findgrid" data-options="{
                        group: '',
                        include: 'Product_url',
                        dialogOptions: {title:'选择文件'},
                        gridOptions: {
                            local: 'local',
                            dataUrl: 'Product/search',
                            columns: [
                                {name:'Product_url', label:'名称', width:100},
                                {name:'uploadurl', label:'地址'},
                                {name:'date', label:'创建日期'}
                            ]
                        }
                    }">  <a class="btn btn-green" href="Product/Upload" data-toggle="dialog" data-mask="true" data-width="500" data-height="150" data-id="ProductUpload" data-icon="cloud-upload">上传文件</a>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">产品说明：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Product_txt" id="Product_txt" maxlength="15" value="" size="20" placeholder="产品说明">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">状态：</label>
                        </td>
                        <td>
                            <input runat="server" type="checkbox" id="Disable" name="Disable" value="1" checked data-toggle="icheck" data-label="正常">

                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">备注：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Disabledesc" id="Disabledesc" maxlength="15" value="" size="20" placeholder="备注">
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">取消</button></li>
        <li><button type="submit" class="btn-green" data-icon="save">提交</button></li>
    </ul>
</div>